'use strict'
const webpack = require('webpack')

/**
 * meipian.config.js for context
 * @param  {Object} jwconf meipian runtime congfig
 * @return {Object}        webpack config object
 */
module.exports = function(jwconf) {
  return {
    module: {
      rules: [{
        test: /\.(js|jsx)$/,
        use: {
          loader: 'babel-loader',
          options: {
            presets: ['es2015', 'react'],
            plugins: ['transform-runtime', 'transform-es2015-modules-umd', 'transform-class-properties']
          }
        },
        exclude: /node_modules/
      }]
    },
    plugins: [
      new webpack.ProvidePlugin({
        React: 'react'
      })
    ]
  }
}
